/*
 * $RCSfile: PaintServer.java,v $
 *
 * Copyright  1990-2009 Sun Microsystems, Inc. All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version
 * 2 only, as published by the Free Software Foundation. 
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License version 2 for more details (a copy is
 * included at /legal/license.txt). 
 * 
 * You should have received a copy of the GNU General Public License
 * version 2 along with this work; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA 
 * 
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
 * Clara, CA 95054 or visit www.sun.com if you need additional
 * information or have any questions. 
 */
package com.sun.perseus.j2d;

/**
 * The PaintServer interface is used to allow the notion of both paint values
 * (sush as RGB colors) and more sophisticated paint servers.
 *
 * @version $Id: PaintServer.java,v 1.3 2006/04/21 06:35:01 st125089 Exp $
 */
public interface PaintServer {
    /**
     * @return the PaintDef generated by the server.
     */
    public PaintDef getPaintDef();

    /**
     * @param paintType a key that the PaintTarget can use to characterize its 
     *        interest in the PaintServer. For example, a PaintTarget may be interested in the 
     *        Paint both for stroking and filling purposes.
     * @param paintTarget the PaintTarget listening to changes to the paint generated by this 
     *        PaintServer.
     */
    public void setPaintTarget(final String paintType,
                               final PaintTarget paintTarget);

    /**
     * Called when the PaintServer is no longer used
     */
    public void dispose();
}
